package com.zb.kc.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 课程科目
 * </p>
 *
 * @author wanggen
 * @since 2020-04-09
 */
public class EduSubject extends Model<EduSubject> {

    private static final long serialVersionUID = 1L;

    /**
     * 课程类别ID
     */
    @ApiModelProperty(value = "课程类别id")
    private String id;

    /**
     * 类别名称
     */
    @ApiModelProperty(value = "类别名称")
    private String title;

    /**
     * 父ID
     */
    @ApiModelProperty(value = "父id")
    private String parentId;

    /**
     * 排序字段
     */
    @ApiModelProperty(value = "排序字段")
    private Integer sort;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    /**
     * 树的深度
     */
    @ApiModelProperty(value = "树的深度")
    private Integer dept;

    @ApiModelProperty(value = "当前分类下的所有子分类")
    @TableField(exist = false)
    private List<EduSubject> childSubs;

    public List<EduSubject> getchildSubs() {
        return childSubs;
    }

    public void setchildSubs(List<EduSubject> childSubs) {
        this.childSubs = childSubs;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "EduSubject{" +
                "id=" + id +
                ", title=" + title +
                ", parentId=" + parentId +
                ", sort=" + sort +
                ", gmtCreate=" + gmtCreate +
                ", gmtModified=" + gmtModified +
                ", dept=" + dept +
                "}";
    }
}
